import { defHttp } from '/@/utils/http/axios';
import { IPostGradeUpdateRaw } from '/@/types/system/auxiliary/grade/update';
import { IGetGradeDropdownResponse } from '/@/types/system/auxiliary/grade/dropdown';
import { IPostGradeListRequest, IPostGradeListResponse } from '/@/types/system/auxiliary/grade/list';
import { IGetRawGradeDetailsResponse } from '/@/types/system/auxiliary/grade/details';
import { IPostGradeAddRequest } from '/@/types/system/auxiliary/grade/add';

/**
 * 修改客户等级
 */
export const apiPostGradeUpdatePath = (id: string | number, params: IPostGradeUpdateRaw) =>
  defHttp.post({ url: `/system/auxiliary/grade/update/${id}`, params });
/**
 * 删除客户等级
 */
export const apiPostGradeDeletePath = (id: string | number) => defHttp.post({ url: `/system/auxiliary/grade/delete/${id}` });
/**
 * 客户等级下拉框
 */
export const apiGetGradeDropdown = () => defHttp.get<IGetGradeDropdownResponse>({ url: `/system/auxiliary/grade/dropdown` });
/**
 * 客户等级列表
 */
export const apiPostGradeList = (params: IPostGradeListRequest) =>
  defHttp.post<IPostGradeListResponse>({ url: `/system/auxiliary/grade/list`, params });
/**
 * 客户等级详情
 */
export const apiGetGradeDetailsPath = (id: string | number) =>
  defHttp.get<IGetRawGradeDetailsResponse>({ url: `/system/auxiliary/grade/details/${id}` });
/**
 * 新增客户等级
 */
export const apiPostGradeAdd = (params: IPostGradeAddRequest) => defHttp.post({ url: `/system/auxiliary/grade/add`, params });
